/*************************************************************************  
 *   This file is part of UBBMPSREADER.
 *
 *   UBBMPSREADER is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   UBBMPSREADER is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with UBBMPSREADER.  If not, see <http://www.gnu.org/licenses/>. 
 *************************************************************************/

package cs.ubbcluj.ro.mps.states;

import java.io.IOException;

import org.apache.log4j.Logger;

import cs.ubbcluj.ro.common.CommonTools;
import cs.ubbcluj.ro.mps.data.interfaces.Mps;
import cs.ubbcluj.ro.mps.reader.MpsInputStream;
import cs.ubbcluj.ro.mps.states.interfaces.State;

/**
 * Represents an error state
 * 
 * @author avadas
 * @version 3.5
 */
public strictfp class ErrorState extends AbstractState {

    /** Logger */
    private static final Logger LOG = CommonTools.getLogger(ErrorState.class);

    /**
     * Constructor
     * 
     * @param nextState
     * @param errorState
     */
    public ErrorState(final State nextState, final State errorState) {
	super(nextState, errorState);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public State nextState(final MpsInputStream input, final Mps mps)
	    throws IOException {

	throw new IOException("Parse error in row: " + input.getRow()
		+ " column: " + input.getColumn());
    }
}
